package com.acc.sys.controller;

import apijson.framework.APIJSONController;
import com.acc.sys.framework.AccParser;
import com.acc.sys.service.AdminAuthService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.io.UnsupportedEncodingException;


@RestController
@RequestMapping("/api")
@AllArgsConstructor
public class AccController extends APIJSONController<String> {

    @PostMapping("/get")
    public String get(@RequestBody String request) {
        return super.get(request, null);
    }

    @PostMapping("/gets")
    public String gets(@RequestBody String request) {
        return super.gets(request, null);
    }

    @PostMapping("delete")
    public String delete(@RequestBody String request) {
        return super.delete(request, null);
    }

    @PostMapping("put")
    public String put(@RequestBody String request) {
        return super.put(request, null);
    }

    @PostMapping("post")
    public String post(@RequestBody String request) {
        return super.post(request, null);
    }

    @PostMapping("post/{tag}")
    public String postTag(@PathVariable String tag, @RequestBody String request) {
        return super.postByTag(tag, null, request, null);
    }
    @PostMapping("put/{tag}")
    public String putTag(@PathVariable String tag, @RequestBody String request) {
        return super.putByTag(tag, null, request, null);
    }

    @PostMapping("get/{tag}")
    public String getTag(@PathVariable String tag, @RequestBody String request) {
        return super.getByTag(tag, null, request, null);
    }

    @PostMapping("gets/{tag}")
    public String getsTag(@PathVariable String tag, @RequestBody String request) {
        return super.getsByTag(tag, null, request, null);
    }

    @PostMapping("delete/{tag}")
    public String deleteByTag(@PathVariable String tag, @RequestBody String request) {
        return super.deleteByTag(tag, null, request, null);
    }


}
